package cn.tedu.vue_master.oauth2;

import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.security.oauth2.provider.OAuth2Authentication;

import javax.servlet.http.HttpServletRequest;

/**
 * oauth2客户端信息 服务类
 */
public interface OAuthClientService {
    public Boolean hasPermission(HttpServletRequest request, OAuth2Authentication authentication);
    /**
     * 根据客户端ID查询客户端
     *
     * @param clientId 客户端ID
     * @return 客户端
     */
    ClientDetails loadClientByClientId(String clientId);

    /**
     * 根据客户端ID查询
     *
     * @param clientEntity 客户端ID
     * @return 执行结果
     */
    OAuthClientEntity findByClientId(OAuthClientEntity clientEntity);

    /**
     * 根据客户端ID更新
     *
     * @param clientEntity 客户端信息
     * @return 执行结果
     */
    int updateByClientId(OAuthClientEntity clientEntity);
}
